import request from "@/utils/request";
import type { CategoryList } from "./type/categoryType";
const enum Api {
  getCategory1List = "/admin/product/getCategory1",
  getCategory2List = "/admin/product/getCategory2",
  getCategory3List = "/admin/product/getCategory3",
}
// 获取一级商品分类列表
export const getCategory1ListApi = () => {
  return request.get<never, CategoryList>(Api.getCategory1List);
};
// 获取二级商品分类列表
export const getCategory2ListApi = (category1Id: number) => {
  return request.get<never, CategoryList>(
    Api.getCategory2List + `/${category1Id}`
  );
};
// 获取三级商品分类列表
export const getCategory3ListApi = (category2Id: number) => {
  return request.get<never, CategoryList>(
    Api.getCategory3List + `/${category2Id}`
  );
};

